package com.yby6.system.mapper;

import com.yby6.common.core.domain.SysRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysRoleMapper {
    /**
     * delete by primary key
     *
     * @param roleId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long roleId);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(SysRole record);

    /**
     * select by primary key
     *
     * @param roleId primary key
     * @return object by primary key
     */
    SysRole selectByPrimaryKey(Long roleId);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(SysRole record);

    /**
     * 分页查询角色列表
     *
     * @param sysRole
     * @return
     */
    List<SysRole> list(SysRole sysRole);

    /**
     * 根据ID批量删除角色
     *
     * @param ids
     * @return
     */
    int deleteByIds(@Param("ids") Long[] ids);

    /**
     * 查询全部角色信息
     * @return
     */
    List<SysRole> getRoleAll();

    /**
     * 根据用户ID查询拥有的角色
     * @param userId
     * @return
     */
	List<Integer> selectRoleListByUserId(Long userId);
}